<!-- 
 @Author: LW   
 @Date: 2020-12-10 09:05:28   
 @function: 入口界面
 -->
<template>
  <div class="entrance">
    <el-dropdown class="user">
      <span class="userinfo">
        <img :src="userInfo.pictureurl"  class="userpic" />
        {{userInfo.realname}}
      </span>
    </el-dropdown>
    <img src="@/assets/images/entrance/centerlogo.png" alt class="logotit" />
    <div class="box">
      <el-row>
        <el-col :span="8">
          <div
            class="left"
            :class="active == 'left' ? 'active' : ''"
            @mouseover="active = 'left'"
            @click="enterEIM()"
          >
            <i class="iconfont iconneiwuguanli"></i>
            <div>内务管理</div>Housekeeping
          </div>
        </el-col>
        <el-col :span="8">
          <div
            class="center"
            :class="active == 'center' ? 'active' : ''"
            @mouseover="active = 'center'"
            @click="enterFileSystem()"
          >
            <i class="iconfont icondanganguanli"></i>
            <div>档案管理</div>File management
          </div>
        </el-col>
        <el-col :span="8">
          <div
            class="right"
            :class="active == 'right' ? 'active' : ''"
            @mouseover="active = 'right'"
            @click="enterDevOps()"
          >
            <i class="iconfont iconyunweixitong"></i>
            <div>运维管理</div>Operation and maintenance system
          </div>
        </el-col>
      </el-row>
      <div class="circlebox">
        <span class="circle" :class="active == 'left' ? 'active' : ''"></span>
        <span class="circle" :class="active == 'center' ? 'active' : ''"></span>
        <span class="circle" :class="active == 'right' ? 'active' : ''"></span>
      </div>
      <div class="txt1">专业创造价值 诚信铸就未来</div>
      <div class="txt2">Professionalism creates value, integrity creates the future</div>
    </div>
  </div>
</template>

<script>
import Crypto from '@/utils/crypto';
export default {
  data() {
    return {
      active: "", //当前的高亮组
      userInfo:{
        pictureurl: require("@/assets/images/userpic.jpg")
      },
    };
  },
  beforeCreate() {},
  /**
   * html加载完成之前，执行。执行顺序：父组件-子组件
   */
  created() {},
  /**
   * 页面初始化方法[html加载完成后执行。执行顺序：子组件-父组件]
   */
  mounted() {
    this.userInfo=this.$store.getters.userInfo;
    this.userInfo.pictureurl =this.$store.getters.fileServerURI+this.userInfo.picture_url;
  },
  methods: {
    //进入内务系统
    enterEIM() {
      let data = JSON.stringify([this.userInfo.name, JSON.parse(this.userInfo.token).refresh_token]);
      var encrypted = Crypto.encryption(data);
      window.location.href =this.$store.getters.eimUrl+"/#/transition/"+encrypted;
    },
     //进入档案管理系统
    enterFileSystem() {
      let data = JSON.stringify([
        this.userInfo.name,
        JSON.parse(this.userInfo.token).refresh_token,
      ]);
      var encrypted = Crypto.encryption(data);
      window.location.href = this.$store.getters.archiveUrl + "/#/transition/" + encrypted;
    },
    //进入运维管理系统
    enterDevOps() {
      this.$router.push({ path: "/home" });
    }
  }
};
</script>
<style scoped>
@import "../../assets/css/entrance/index.scss";
</style>
